<?php
class SubmissionModel extends Model {
	public function getNumRecords() {
		$this->query('SELECT COUNT(*) AS `c` FROM `submissions`');
		return $this->getValue();
	}
	
	public function getRecordRange($first, $perpage) {
		$this->query("SELECT `s`.*, `u`.`school` AS `school` FROM `submissions` AS `s`, `users` AS `u` WHERE `u`.`uid` = `s`.`uid`  ORDER BY `s`.`time` DESC LIMIT $first, $perpage");
		return $this->getRows();
	}
}
